<?php
	class kekhaigiaodichbs
	{
		// Các trường
		public $SoButToan = ""; // auto_increment
		public $MaSoTietKiem = "";
		public $SoKheUoc = "";
		public $MaLoaiGiaoDich = 0;
		public $MaNguoiDung = "";
		public $NgayGiaoDich = "";
		public $SoTienTaiKhoanNo = 0;
		public $SoTienTaiKhoanCo = 0;
		public $NgayBatDau="";
		public $NgayKetThuc="";
		// Các phương thức
		public function Them()
		{
			$db = new kekhaigiaodichdb();
			return $db->Them(
							 $this->SoButToan,
							 $this->MaSoTietKiem,
							 $this->SoKheUoc,
							 $this->MaLoaiGiaoDich,
						     $this->MaNguoiDung,
						     $this->NgayGiaoDich,
							 $this->SoTienTaiKhoanNo,
							 $this->SoTienTaiKhoanCo);
		}
		
		public function CapNhat()
		{
			$db = new kekhaigiaodichdb();
			return $db->CapNhat($this->SoButToan,
								$this->MaSoTietKiem,
								$this->SoKheUoc,
							 	$this->MaLoaiGiaoDich,
						     	$this->MaNguoiDung,
						     	$this->NgayGiaoDich,
								$this->SoTienTaiKhoanNo,
								$this->SoTienTaiKhoanCo);
		}
		
		public function LayDanhSach()
		{
			$db = new kekhaigiaodichdb();
			return $db->LayDanhSach($this->SoButToan,
									$this->MaSoTietKiem,
									$this->SoKheUoc,
							 		$this->MaLoaiGiaoDich,
						     		$this->MaNguoiDung,
						     		$this->NgayGiaoDich,
									$this->SoTienTaiKhoanNo,
									$this->SoTienTaiKhoanCo);
		}
		
		public function LayDanhSachKhoangNgay()
		{
			$db = new kekhaigiaodichdb();
			return $db->LayDanhSachKhoangNgay($this->NgayBatDau, $this->NgayKetThuc);
		}
		
		public function LayDanhSachKhoangNgaySoTietKiem()
		{
			$db = new kekhaigiaodichdb();
			return $db->LayDanhSachKhoangNgaySoTietKiem($this->MaSoTietKiem, $this->NgayBatDau, $this->NgayKetThuc);
		}
		
		public function LayDanhSachKhoangNgayHopDongTinDung()
		{
			$db = new kekhaigiaodichdb();
			return $db->LayDanhSachKhoangNgayHopDongTinDung($this->SoKheUoc, $this->NgayBatDau, $this->NgayKetThuc);
		}
		
		public function LayDanhSachTheoSoTietKiem()
		{
			$db = new kekhaigiaodichdb();
			return $db->LayDanhSachTheoSoTietKiem($this->SoButToan,
													$this->MaSoTietKiem,
													$this->SoKheUoc,
											 		$this->MaLoaiGiaoDich,
										     		$this->MaNguoiDung,
										     		$this->NgayGiaoDich,
													$this->SoTienTaiKhoanNo,
													$this->SoTienTaiKhoanCo);
		}
		
		public function LayDanhSachTheoHopDongTinDung()
		{
			$db = new kekhaigiaodichdb();
			return $db->LayDanhSachTheoHopDongTinDung($this->SoButToan,
													$this->MaSoTietKiem,
													$this->SoKheUoc,
													$this->MaLoaiGiaoDich,
													$this->MaNguoiDung,
													$this->NgayGiaoDich,
													$this->SoTienTaiKhoanNo,
													$this->SoTienTaiKhoanCo);
		}
		
		public function Xoa()
		{
			$db = new kekhaigiaodichdb();
			return $db->Xoa($this->SoButToan);
		}	
	}
?>